﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel;

namespace S4Store.Domain
{
    public class Actionplan
    {
        public enum PlanType
        {
             Sale=1,
             AfterSale=2,
             Marketing=3
        }
        public enum PlanStatus
        {
            [Description("申请中")]
            Application = 1,
        
            [Description("执行中")]
            Excuting = 2,

            [Description("执行完毕")]
            Excuted = 3,

            [Description("已完成")]
            Finish = 4
        }

        public int Id { get; set; }
        public int StoreId { get; set; }
        public int AppUserId { get; set; }
        public DateTime Start { get; set; }
        public DateTime End { get; set; }

        public DateTime FinishStart { get; set; }
        public DateTime FinishEnd { get; set; }

        public DateTime WriteDate { get; set; }

        public int PlanTypeValue { get; set; }
        public int PlanStatusValue { get; set; }
        public String Title { get; set; }
        public String Content { get; set; }
        public String Achievement { get; set; }
        public string Reason { get; set; }
        public string ConfirmInfo { get; set; }

        [NotMapped]
        public PlanType Type {
            get { return PlanTypeValue.ToEnum<PlanType>(); }
            set { PlanTypeValue = value.ToInt(); }
        }
        [NotMapped]
        public PlanStatus Status
        {
            get { return PlanStatusValue.ToEnum<PlanStatus>(); }
            set { PlanStatusValue = value.ToInt(); }
        }

        public virtual Store Store { get; set; }
        public virtual Administrator AppUser { get; set; }
    }
}
